package cz.pproproj.aaservice.guimodule.auth;

import com.fasterxml.jackson.annotation.JsonInclude;
import cz.pproproj.aaservice.guimodule.config.AuthService;
import cz.pproproj.aaservice.guimodule.model.User;


/**
 * Pair of user and his/her token info.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserInfo {

    private final User user;
    private final TokenInfo tokenInfo;


    public UserInfo(AuthService.UserTokens userTokens) {
        this.user = userTokens.getUser();
        this.tokenInfo = userTokens.getTokenInfo();

    }

    /**
     * Gets a user of this info.
     *
     * @return user
     */
    public User getUser() {
        return user;
    }

    /**
     * Gets tokens of this info.
     *
     * @return tokens
     */
    public TokenInfo getTokenInfo() {
        return tokenInfo;
    }


}
